package scenes;

import utils.ComponentsHashTable;

import com.uqbar.vainilla.GameScene;
import components.CollisionableComponent;
import components.blocks.Block;
import components.blocks.PupBlock;

public abstract class  CollisionablesScene extends GameScene {
	private ComponentsHashTable componentsTable;

	public CollisionablesScene(int tableQuadrantSize, int tableWidth, int tableHeight){
		this.componentsTable = new ComponentsHashTable(tableQuadrantSize, tableWidth, tableHeight);
	}
	
	public void setComponentsTable(ComponentsHashTable componentsTable) {
		this.componentsTable = componentsTable;
	}

	public ComponentsHashTable getComponentsTable() {
		return componentsTable;
	}
	
	public void addCollisionable(CollisionableComponent gc){
		this.addComponent(gc);
		this.getComponentsTable().addCollisionableComponent(gc, gc.getX(), gc.getY());
	}
	
	// no esta bueno esto aca, pero dado que no va a crecer mucho el proyecto, lo mando
	public void blockDestroyed(Block block){
		
	}
	public void launchPowerUp(PupBlock pupBlock) {
		// TODO Auto-generated method stub
	}
	
	public void removeCollisionable(CollisionableComponent gc){
		this.getComponentsTable().remove(gc, gc.getX(), gc.getY());
		gc.destroy();
		this.removeComponent(gc);

	}


}
